<!-- eslint-disable vue/custom-event-name-casing -->
<!-- eslint-disable vue/custom-event-name-casing -->
<template>
	<view class="outers">
		<view class="wraps">
			<view class="item_tops">
				<view class="top_lefts">{{ type == 'in' ? '入场签到' : '离场签退' }}</view>
				<!-- <view class="top_rights"><text>今天 09:20</text></view> -->
			</view>
			<!-- <view class="item_location"><uniicons  type="location-filled"/> 豪逸华庭1期</view> -->
			<view class="item_locations">
				<image src="@/static/images/location.png"></image> {{ signinData.buildingName }}
			</view>
			<view class="item_adms">
				<image src="@/static/images/jiantou.png"></image>{{ type == 'in' ? '入场照' : '离场照' }}
			</view>
			<view class="item_imgs">
				<view class="imgs">
					<imageDragSort :uploadrecord="false" :uploadType='2' :parentStyle="parentStyle" :list="lists" @changeList="changeImg"
						:max="1"></imageDragSort>
				</view>
			</view>
			<!-- <view class="item_tips"><image src="/static/images/tipsx.png"></image>请在指定范围打卡</view> -->
			<view class="item_bottoms">
				<view @click="canceltime">取消</view>
				<view @click="signintime">{{ type == 'in' ? '签到' : '签退' }}</view>
			</view>
		</view>
	</view>
</template>

<script>
import imageDragSort from '@/components/image-drag-sort/index.vue';
export default {
	name: 'timeSignin',
	data() {
		return {
			parentStyle: '0;',

		};
	},
	components: {
		imageDragSort,
	},
	props: {
		type: {
			type: String,
			// in 签到  out签退
			default: 'in'  
		},
		signinData: {
			type: Object,
			default() {
				return {};
			}
		},
		lists: Array
	},
	watch: {

	},
	methods: {
		popupChange(e) {
			this.$emit('input', e.show);
		},
		canceltime() {
			this.$emit('close', 0);
		},
		signintime() {
			uni.showLoading({
				title: '加载中',
				mask: true
			});
			this.$emit('close', 1);
			// this.lists = []
		},
		changeImg(val) {
			// eslint-disable-next-line
			this.$emit('changeImg', val);
		}
	}
};

</script>

<style lang="scss" scoped>
.outers {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 300;
	background: rgba(0, 0, 0, .5);
	display: flex;
	align-items: center;
	justify-content: center;

	.wraps {

		display: flex;
		flex-direction: column;
		justify-content: center;
		width: 506rpx;
		border-radius: 16rpx;
		background: #ffffff;

		.item_tops {
			display: flex;
			flex-direction: row;
			border-top-left-radius: 16rpx;
			border-top-right-radius: 16rpx;
			height: 88rpx;
			background: #0091ff;

			.top_lefts {
				flex: 1;
				align-self: center;
				height: 44rpx;
				font-size: 32rpx;
				font-weight: 500;
				color: #ffffff;
				line-height: 44rpx;
				margin-left: 28rpx;
			}

			.top_rights {
				flex: 1;
				align-self: center;
				text-align: right;
				margin-right: 28rpx;

				text {
					display: inline-block;
					width: 152rpx;
					background: #ffffff;
					border-radius: 20rpx;
					text-align: center;
					height: 32rpx;
					font-size: 24rpx;
					font-weight: 400;
					color: #0091ff;
					line-height: 32rpx;
				}

			}
		}

		.item_locations {
			margin-top: 24rpx;
			margin-left: 24rpx;
			height: 40rpx;
			font-size: 28rpx;
			font-weight: 400;
			text-align: left;
			color: #333333;
			line-height: 40rpx;

			image {
				width: 30rpx;
				height: 30rpx;
				vertical-align: middle;
			}
		}

		.item_adms {
			margin-top: 32rpx;
			margin-left: 24rpx;
			height: 40rpx;
			font-size: 28rpx;
			font-weight: 400;
			text-align: left;
			color: #333333;
			line-height: 40rpx;

			image {
				width: 30rpx;
				height: 30rpx;
				vertical-align: middle;
			}
		}

		.item_imgs {
			margin-top: 24rpx;

			.imgs {
				margin: 0 auto;
				width: 196rpx;
				height: 196rpx;
				background: #f7f7f8;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
			}

			.imgyes {
				margin: 0 auto;
				width: 196rpx;
				height: 196rpx;
				background: #FFFFFF;
				// border: 1rpx #C0C0C0 solid;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
			}
		}

		.item_tips {
			align-self: center;
			margin-top: 10rpx;
			height: 34rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			line-height: 34rpx;

			image {
				width: 30rpx;
				height: 30rpx;
				vertical-align: middle;
			}
		}

		.item_bottoms {
			display: flex;
			flex-direction: row;
			height: 73rpx;
			border-top: 1rpx #f5f5f5 solid;
			margin-top: 20rpx;
			line-height: 73rpx;

			view:nth-child(1) {
				flex: 1;
				font-size: 28rpx;
				font-weight: 400;
				text-align: center;
				color: #999999;
				background: #ffffff;
				border-right: 1rpx #f5f5f5 solid;
			}

			view:nth-child(2) {
				flex: 1;
				font-size: 28rpx;
				background: #ffffff;
				font-weight: 400;
				text-align: center;
				color: #0091ff;
			}

		}
	}
}
</style>
